package br.com.toscano.contpedido.view;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;

import br.com.toscano.contpedido.business.LocalProducaoBC;
import br.com.toscano.contpedido.business.PedidoBC;
import br.com.toscano.contpedido.domain.LocalProducao;
import br.com.toscano.contpedido.otd.ProducaoOTD;
import br.gov.frameworkdemoiselle.annotation.NextView;
import br.gov.frameworkdemoiselle.annotation.PreviousView;
import br.gov.frameworkdemoiselle.stereotype.ViewController;
import br.gov.frameworkdemoiselle.template.AbstractListPageBean;
import br.gov.frameworkdemoiselle.template.AbstractPageBean;
import br.gov.frameworkdemoiselle.transaction.Transactional;


@ViewController
@NextView("./pedido_listar_local_producao.jsf")
@PreviousView("./pedido_listar_local_producao.jsf")
public class PedidoListarLocalProducaoMB extends AbstractPageBean {

	private static final long serialVersionUID = 1L;

	@Inject
	private LocalProducaoBC LocalProducaoBC;
	private List<SelectItem> LocalProducaos;
	private Long LocalProducao;

	public List<SelectItem> getLocalProducaos() {
		LocalProducaos = new ArrayList<SelectItem>();
		List<LocalProducao> lista = LocalProducaoBC.findAll();
		for (LocalProducao obj: lista) {
			LocalProducaos.add(new SelectItem(obj.getId() , obj.getDescricao()));
		}
		return LocalProducaos;
	}

	public void setLocalProducaos(List<SelectItem> LocalProducaos) {
		this.LocalProducaos = LocalProducaos;
	}

	public Long getLocalProducao() {
		return LocalProducao;
	}

	public void setLocalProducao(Long LocalProducao) {
		this.LocalProducao = LocalProducao;
	}
	public void filtrar() {

	}

	public void trocarLocalProducao() {
		filtrar();
	}
}